package main

import (
	"fmt"
	"log"
	"os"
)

func MkDirs(dirPath string, perm os.FileMode) error {
	err := os.MkdirAll(dirPath, perm)
	if err != nil {
		log.Fatal("这是什么玩意：", dirPath)
		return err
	}
	return nil
}

// create main function to execute the program
func main() {
	// s, e := os.Getwd()
	// erro.NetErrShow(e)
	// fmt.Println(s)
	err := MkDirs("C:\\Users\\lenovo\\Desktop\\hhhwork\\tmp\\", 0666) //create a new file
	if err != nil {
		fmt.Println(err)
		return
	}
	// defer file.Close()
	fmt.Println("File is created successfully.") //print the success on the console
}
